<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Daily Shipping Report</title>
</head>
<body>
<h1>Daily Shipping Report</h1> 
<?php
date_default_timezone_set('Australia/Melbourne');
$dateToday = date("Y_m_d");
if($_GET['date']){
	$dateToday = $_GET['date'];
	}
$recordFolder = getcwd()."/recorders/";
$kmfilename = "km_recorder_".$dateToday.".csv";
$fileName889 = "889_recorder_".$dateToday.".csv";
echo "Server Date:{$dateToday}";
?><br />
Will do k-mobile/qitty889 for now: Todo is LV & PHwebsite
<hr />
<?php
$arrShipping = array();

$fl = fopen($recordFolder.$kmfilename,"r");
	
	while(($lineData = fgetcsv($fl))!= FALSE){		
			$arrShipping[] = $lineData[2];
			if($lineData[5]!= 0){
			$arrShipping[] = $lineData[5];
				}
		
		}
fclose($fl);
$fl2 = fopen($recordFolder.$fileName889,"r");
	
	while(($lineData2 = fgetcsv($fl2))!= FALSE){		
			$arrShipping[] = $lineData2[2];
			if($lineData2[5]!= 0){
			$arrShipping[] = $lineData2[5];
				}
		
		}
fclose($fl2);

$arrShipResult = array_count_values($arrShipping);

foreach($arrShipResult as $key =>$value){
	
	echo "Shipping Method:".$key." | ".$value." <br />";
	}




?>
</body>
</html>